<template>
  <div class="fieldDetails ">
    <div class="table">
      <!-- <img src="@/assets/images/news_table.png" alt /> -->
      <p>Inherit the legal culture and contend for social justice</p>
    </div>
    <div class="details clearfloat">
      <div class="return" @click="back">
        <span>Go back</span>
        <img src="@/assets/images/return_you.png" alt />
      </div>
      <h1>{{ title }}</h1>

      <div class="content" v-html="content"></div>
    </div>
  </div>
</template>
<script>
import { service_visit } from "@/api/field.js";
export default {
  data() {
    return {
      content: "",
      title: ""
    };
  },
  mounted() {
    let id = this.$route.query.id;
    this.cid = this.$route.query.cid;
    console.log(this.$route);
    service_visit({ id: id }).then(res => {
       if (this.$isMobile()) {
        this.content = this.$pxToRem(res.data.data.content);
      } else {
        this.content = res.data.data.content;
      }
      this.title = res.data.data.title;
    });
  },
  methods: {
    back() {
      if (this.$route.query.search != true) {
        this.$router.replace({ name: "en_field", query: { cid: this.cid } });
      } else {
        this.$router.go(-1); //返回上一层
      }
    }
  }
};
</script>
<style scoped src="./sass/field.css"></style>
